package com.sj.parksdk.fragment.profile;

import com.sj.parksdk.R;
import com.sj.parksdk.R2;
import com.sj.parksdk.core.BaseFragment;
import com.sj.parksdk.setting.Constans;
import com.sj.parksdk.utils.Utils;
import com.xuexiang.xpage.annotation.Page;
import com.xuexiang.xui.widget.textview.supertextview.SuperTextView;

import butterknife.BindView;

@Page(name = "用户协议")
public class FragmentAgreement extends BaseFragment implements SuperTextView.OnSuperTextViewClickListener {
    @BindView(R2.id.api)
    SuperTextView api;
    @BindView(R2.id.privacy)
    SuperTextView privacy;

    @Override
    protected int getLayoutId() {
        return R.layout.parksdk_fragment_user_aggrement;
    }

    @Override
    protected void initViews() {
    }

    @Override
    protected void initListeners() {
        api.setOnSuperTextViewClickListener(this);
        privacy.setOnSuperTextViewClickListener(this);
    }

    @Override
    public void onClick(SuperTextView view) {
        int id = view.getId();
        if (id == R.id.api) {
            Utils.goWeb(getContext(), Constans.API_AGREEMENT);
        } else if (id == R.id.privacy) {
            Utils.goWeb(getContext(), Constans.PRIVACY_AGREEMENT);
        }
    }
}
